<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
 </head>
 <body>
  
 </body>
</html>
<script>
	//约数个数 30
	
	//累加器
	

	function yueshugeshu(a){
		//console.log(a);
		var count = 0;
		for(var i = 1; i <= a; i++){
			if(a % i == 0){
				count++;
			}
		};
		return count;	
	};
	
	//自己想算谁就传谁!!!
	//yueshugeshu(11);
	//yueshugeshu(33);
	//yueshugeshu(55);
	//yueshugeshu(111);

	//要去判断一个数是不是质数？

	function iszhishu(m){
		//console.log(m)
		//约数个数只有2个, 可以用外部的函数方法
		if(yueshugeshu(m) == 2){
			alert('是质数');
		}else{
			alert('不是一个质数');
		};
	};
	
	iszhishu(7);
	
</script>
